package com.ljx.controller;

import com.ljx.common.ResponseResult;
import com.ljx.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author 李捷禧
 * Date: 2023/5/13
 * ClassName: CountController
 */
@RestController
@RequestMapping("/count")
public class CountController {

    @Autowired
    private ArticleService articleService;

    @GetMapping("/find/{create_by}/{startDate}/{endDate}")
    public ResponseResult list(@PathVariable Long create_by, @PathVariable String startDate,
                               @PathVariable String endDate){
        Map<String, Object> map =  articleService.findCount(create_by,startDate,endDate);
        return ResponseResult.okResult(map);
    }

}
